Load libraries

library(STutility)
library(ggplot2)
library(ggpubr)
library(magrittr)
library(dplyr)

Assemble spaceranger output files and merge curated meta data

# Mouse brain
samples <- Sys.glob(paths = "../../spaceranger_output/colon/*/filtered_feature_bc_matrix.h5")
imgs <- Sys.glob(paths = "../../spaceranger_output/colon/*/spatial/tissue_hires_image.png")
spotfiles <- Sys.glob(paths = "../../spaceranger_output/colon/*/spatial/tissue_positions_list.csv")
json <- Sys.glob(paths = "../../spaceranger_output/colon/*/spatial/scalefactors_json.json")

infoTable <- data.frame(samples, imgs, spotfiles, json)
infoTable <- cbind(infoTable, arrayID = do.call(rbind, strsplit(infoTable$samples, "/"))[, 5])

curated_metadata <- openxlsx::read.xlsx("../../sheets/curated_RNA_rescue_sample_metadata.xlsx", sheet = 3)
curated_metadata <- setNames(curated_metadata, nm = c("storage_time", "seq_date", "include", "RNA_rescue",
                                                       "project", "experimenter", "processer", "comments",
                                                       "ID", "paper_id", "RIN", "DV200", "protocol", "source", "arrayID", "spots_under_tissue",
                                                       "genes_detected", "fraction_spots_under_tissue",
                                                       "median_genes_per_spot", "median_UMIs_per_spot", 
                                                       "saturation", "reads_mapped_to_probe_set",
                                                       "reads_mapped_confidently_to_probe_set",
                                                       "reads_mapped_confidently_to_filtered_probe_set",
                                                       "reads_mapped_to_genome",
                                                       "reads_mapped_confidently_to_genome",
                                                       "number_of_panel_genes"))

infoTable <- merge(infoTable, curated_metadata, by = "arrayID")

Load data into a Seurat object

CLN <- InputFromTable(infoTable[c(5:6, 2, 4, 1, 3), ])
## Using spotfiles to remove spots outside of tissue
## Loading ../../spaceranger_output/colon/V11M22-349_A1/filtered_feature_bc_matrix.h5 count matrix from a 'Visium' experiment
## Loading ../../spaceranger_output/colon/V11M22-349_B1/filtered_feature_bc_matrix.h5 count matrix from a 'Visium' experiment
## Loading ../../spaceranger_output/colon/V11A20-396_A1/filtered_feature_bc_matrix.h5 count matrix from a 'Visium' experiment
## Loading ../../spaceranger_output/colon/V11B18-363_C1/filtered_feature_bc_matrix.h5 count matrix from a 'Visium' experiment
## Loading ../../spaceranger_output/colon/V10S29-108_B1/filtered_feature_bc_matrix.h5 count matrix from a 'Visium' experiment
## Loading ../../spaceranger_output/colon/V11A20-396_C1/filtered_feature_bc_matrix.h5 count matrix from a 'Visium' experiment
## 
## ------------- Filtering (not including images based filtering) -------------- 
##   Spots removed:  0  
##   Genes removed:  15588  
## Saving capture area ranges to Staffli object 
## After filtering the dimensions of the experiment is: [21013 genes, 14393 spots]

Check spatial distribution of unique genes

CLN$protocol_array <- paste0(CLN$protocol, " : ", CLN$arrayID)
ST.FeaturePlot(CLN, features = "nFeature_RNA", ncol = 3, label.by = "protocol_array", show.sb = FALSE, pt.size = 1.5)
## Loading required namespace: viridis

Load images

CLN <- LoadImages(CLN, time.resolve = FALSE, xdim = 1e3)
## Loading images for 6 samples: 
##   Reading ../../spaceranger_output/colon/V11M22-349_A1/spatial/tissue_hires_image.png for sample 1 ... 
##   Scaling down sample 1 image from 2000x1937 pixels to 1000x968 pixels 
##   Reading ../../spaceranger_output/colon/V11M22-349_B1/spatial/tissue_hires_image.png for sample 1 ... 
##   Scaling down sample 2 image from 2000x1937 pixels to 1000x968 pixels 
##   Reading ../../spaceranger_output/colon/V11A20-396_A1/spatial/tissue_hires_image.png for sample 1 ... 
##   Scaling down sample 3 image from 1979x2000 pixels to 1000x1011 pixels 
##   Reading ../../spaceranger_output/colon/V11B18-363_C1/spatial/tissue_hires_image.png for sample 1 ... 
##   Scaling down sample 4 image from 1979x2000 pixels to 1000x1011 pixels 
##   Reading ../../spaceranger_output/colon/V10S29-108_B1/spatial/tissue_hires_image.png for sample 1 ... 
##   Scaling down sample 5 image from 1979x2000 pixels to 1000x1011 pixels 
##   Reading ../../spaceranger_output/colon/V11A20-396_C1/spatial/tissue_hires_image.png for sample 1 ... 
##   Scaling down sample 6 image from 1979x2000 pixels to 1000x1011 pixels

Apply rigid transformations to make a rough alignment of the tissue sections.

# Warp transform
CLN <- WarpImages(CLN, verbose = TRUE, transforms = list("1" = list(angle = -90), 
                                                         "2" = list(angle = -90, mirror.x = TRUE), 
                                                         "4" = list(angle = -90), 
                                                         "5" = list(angle = 180), 
                                                         "6" = list(angle = 180)))
## Creating dummy masks ...Loading masked image for sample 1 ... 
## Warping pixel coordinates for 1 ... 
## Warping image for 1 ... 
## Warping image mask for 1 ... 
## Finished alignment for sample1 
## 
## Loading masked image for sample 2 ... 
## Warping pixel coordinates for 2 ... 
## Warping image for 2 ... 
## Warping image mask for 2 ... 
## Finished alignment for sample2 
## 
## Loading masked image for sample 4 ... 
## Warping pixel coordinates for 4 ... 
## Warping image for 4 ... 
## Warping image mask for 4 ... 
## Finished alignment for sample4 
## 
## Loading masked image for sample 5 ... 
## Warping pixel coordinates for 5 ... 
## Warping image for 5 ... 
## Warping image mask for 5 ... 
## Finished alignment for sample5 
## 
## Loading masked image for sample 6 ... 
## Warping pixel coordinates for 6 ... 
## Warping image for 6 ... 
## Warping image mask for 6 ... 
## Finished alignment for sample6

Add manual annotations


Here, the spots were labeled into three major categories: “mucosa”, “submucosa” and “muscularis”.

The annotations are provided in an Rds file (see below)

CLN <- ManualAnnotation(CLN)
# Add labels
pre_ann <- readRDS("data/CLN_metadata_selections")
CLN@meta.data[rownames(pre_ann), "labels"] <- pre_ann[, "labels"]

Add a new metadata column with a combined protocol and lung ID label

CLN$cln_id <- CLN[[]] %>%
  mutate(cln_id = ifelse(paper_id == "1.0", "Sample 1", "Sample 2")) %>%
  pull(cln_id)

CLN$protocol_sample <- gsub(pattern = " ", replacement = "_", paste0(CLN$protocol, "_ID: ", CLN$cln_id))
ST.FeaturePlot(CLN, features = "nFeature_RNA", ncol = 3, label.by = "protocol_sample")

Filter out background

CLN <- SubsetSTData(CLN, expression = labels %in% c("mucosa", "submucosa", "muscularis"))

Create H&E + spatial maps of unique genes for Figure 3a


infoTable[c(5:6, 2, 4, 1, 3), 1]
## [1] "V11M22-349_A1" "V11M22-349_B1" "V11A20-396_A1" "V11B18-363_C1"
## [5] "V10S29-108_B1" "V11A20-396_C1"
limits_list <- list("2" = c(x_start = 260, y_start = 500, x_end = 1600, y_end = 1800),
                    "3" = c(x_start = 170, y_start = 340, x_end = 1400, y_end = 1500),
                    "4" = c(x_start = 130, y_start = 240, x_end = 1780, y_end = 1560),
                    "6" = c(x_start = 300, y_start = 280, x_end = 1820, y_end = 1700))

ann_plots <- lapply(c("2", "3", "4", "6"), function(i) {
  
  gg <- cbind(CLN[[]], GetStaffli(CLN)@meta.data)
  gg <- subset(gg, sample == i)
  dims <- GetStaffli(CLN)@dims[[i]]
  
  p <- ggplot(gg, aes(warped_x, dims$height - warped_y, color = labels)) +
    geom_point(size = 1) +
    theme_void() +
    scale_color_manual(values = c("mucosa" = "#AA4499", "submucosa" = "#DDCC77", "muscularis" = "#CC6677")) +
    scale_x_continuous(expand = c(0, 0), limits = c(limits_list[[i]]["x_start"], 
                                  limits_list[[i]]["x_end"])) +
    scale_y_continuous(expand = c(0, 0), limits = c(dims$height - limits_list[[i]]["y_end"], 
                                  dims$height - limits_list[[i]]["y_start"])) +
    theme(legend.position = "none")

  p <- ggrastr::rasterize(p, layers = "Point", dpi = 300)
  return(p)
})

# HE images
plots_HE <- lapply(c("2", "3", "4", "6"), function(i) {
  im <- GetStaffli(CLN)@rasterlists$processed[[paste0(i)]]
  dims <- GetStaffli(CLN)@dims[[i]]
   
  im <- im[limits_list[[i]]["y_start"]:limits_list[[i]]["y_end"]*0.5, limits_list[[i]]["x_start"]:limits_list[[i]]["x_end"]*0.5]
  g <- grid::rasterGrob(im, width = unit(1, "npc"), height = unit(1, "npc"), interpolate = TRUE)
  p <- ggplot() +
    annotation_custom(g, -Inf, Inf, -Inf, Inf) +
    theme_void() +
    theme(plot.margin = margin(t = 0, r = 0, b = 0, l = 0))
  return(p)
})

p1 <- plots_HE[[1]] + 
  ann_plots[[1]]
p1
## Warning: Removed 110 rows containing missing values (geom_point).

p2 <-  plots_HE[[2]] +
  ann_plots[[2]]
p2
## Warning: Removed 161 rows containing missing values (geom_point).

p3 <-  plots_HE[[3]] +
  ann_plots[[3]]
p3
## Warning: Removed 21 rows containing missing values (geom_point).

p4 <-  plots_HE[[4]] +
  ann_plots[[4]]
p4
## Warning: Removed 46 rows containing missing values (geom_point).

pdf(file = "plots/sample1_HE_unique_genes_RRST.pdf", width = 6.3, height = 3.05)
print(p1)
dev.off()

pdf(file = "plots/sample1_HE_unique_genes_standard.pdf", width = 5.7, height = 2.9)
print(p2)
dev.off()

pdf(file = "plots/sample2_HE_unique_genes_RRST.pdf", width = 7.8, height = 3.2)
print(p3)
dev.off()

pdf(file = "plots/sample2_HE_unique_genes_standard.pdf", width = 7, height = 3.4)
print(p4)
dev.off()

Violin plots for Figure 3 c and d


th <- theme(panel.background = element_rect(fill = "white", colour = "lightgray"), 
          panel.grid = element_line(colour = "lightgray", linetype = "longdash"), 
          axis.text.x = element_blank(),
          axis.text.y = element_text(size = 14, color = "black"), 
          plot.title = element_text(size = 18, face = "bold"), 
          axis.ticks.x = element_blank(), 
          strip.text = element_text(size = 16, color = "white", face = "bold"),
          legend.text = element_text(size = 14),
          legend.title = element_text(size = 16), legend.position = "bottom") 

dt <- CLN[[]] %>% 
  mutate(protocol = setNames(c("RRST", "standard"), nm = c("RNA rescue", "standard"))[protocol]) %>%
  mutate(labels = factor(setNames(c("Mucosa", "Submucosa", "Muscularis"), 
                                  nm = c("mucosa", "submucosa", "muscularis"))[labels], 
                         levels = c("Mucosa", "Submucosa", "Muscularis")), 
         arrayID = factor(arrayID, levels = c("V11M22-349_A1", "V11M22-349_B1", "V11A20-396_A1",
                                              "V10S29-108_B1", "V11B18-363_C1", "V11A20-396_C1")))

p1 <- ggplot() +
    geom_violin(data = dt, aes(arrayID, nFeature_RNA, fill = protocol), scale = "width") +
    geom_point(data = dt %>% 
                 mutate(replicate = setNames(c("rep1", "rep2", "rep1", "rep1", "rep2", "rep1"), 
                                       nm = c("V11M22-349_A1", "V11M22-349_B1", "V11A20-396_A1",
                                              "V10S29-108_B1", "V11B18-363_C1", "V11A20-396_C1"))[arrayID]) %>%
                 group_by(labels, cln_id, arrayID, replicate) %>% 
                 summarize(Mean = median(nFeature_RNA)), 
               aes(arrayID, Mean, shape = replicate), size = 3) +
    scale_shape_manual(values = c("rep1" = 4, "rep2" = 6)) +
    facet_grid(cln_id~labels, scales = "free", space = "free") +
    labs(y = "", x = "", title = "Unique genes") +
    th +
    scale_y_log10()

p2 <- ggplot() +
    geom_violin(data = dt, aes(arrayID, nCount_RNA, fill = protocol), scale = "width") +
    geom_point(data = dt %>% 
                 mutate(replicate = setNames(c("rep1", "rep2", "rep1", "rep1", "rep2", "rep1"), 
                                       nm = c("V11M22-349_A1", "V11M22-349_B1", "V11A20-396_A1",
                                              "V10S29-108_B1", "V11B18-363_C1", "V11A20-396_C1"))[arrayID]) %>%
                 group_by(labels, cln_id, arrayID, replicate) %>% 
                 summarize(Mean = median(nCount_RNA)), 
               aes(arrayID, Mean, shape = replicate), size = 3) +
    scale_shape_manual(values = c("rep1" = 4, "rep2" = 6)) +
    facet_grid(cln_id~labels, scales = "free") +
    labs(y = "", x = "", title = "UMI counts") +
    th +
    scale_y_log10()

p <- p1 | p2
p
# Export plot
pdf(file = "plots/violin_QC_by_region.pdf", width = 14*1.2, height = 6*1.2)
print(p)
dev.off()
CLN$unique_genes_log10 <- log10(CLN$nFeature_RNA)
CLN$UMIs_log10 <- log10(CLN$nCount_RNA)
CLN$UMIs_log10[CLN$UMIs_log10 < quantile(CLN$UMIs_log10, 0.01)] <- quantile(CLN$UMIs_log10, 0.01)
col_dims <- c(min(CLN$UMIs_log10), max(CLN$UMIs_log10))

ann_plots <- lapply(c("2", "3", "4", "6"), function(i) {
  gg <- cbind(CLN[[]], GetStaffli(CLN)@meta.data)
  gg <- subset(gg, sample == i)
  dims <- GetStaffli(CLN)@dims[[i]]
  
  p <- ggplot(gg, aes(warped_x, dims$height - warped_y, color = UMIs_log10)) +
    geom_point(size = 1) +
    theme_void() +
    scale_color_gradientn(colours = RColorBrewer::brewer.pal(n = 11, name = "Spectral") %>% rev(), 
                          breaks = c(2, 3, 4), labels = c(100, 1000, 10000),
                          limits = col_dims) +
    scale_x_continuous(expand = c(0, 0), limits = c(limits_list[[i]]["x_start"], 
                                  limits_list[[i]]["x_end"])) +
    scale_y_continuous(expand = c(0, 0), limits = c(dims$height - limits_list[[i]]["y_end"], 
                                  dims$height - limits_list[[i]]["y_start"])) +
    theme(legend.position = "none")
  
  p <- ggrastr::rasterize(p, layers = "Point", dpi = 300)
  return(p)
})

ann_plots[[1]] + ann_plots[[2]]
## Warning: Removed 110 rows containing missing values (geom_point).
## Warning: Removed 161 rows containing missing values (geom_point).

ann_plots[[3]] + ann_plots[[4]]
## Warning: Removed 21 rows containing missing values (geom_point).
## Warning: Removed 46 rows containing missing values (geom_point).

pdf(file = "plots/sample1_RRST_UMIs_log10.pdf", width = 3.15, height = 3)
print(ann_plots[[1]])
dev.off()

pdf(file = "plots/sample1_standard_UMIs_log10.pdf", width = 2.75, height = 2.7)
print(ann_plots[[2]])
dev.off()

pdf(file = "plots/sample2_RRST_UMIs_log10.pdf", width = 3.9, height = 3)
print(ann_plots[[3]])
dev.off()

pdf(file = "plots/sample2_standard_UMIs_log10.pdf", width = 3.5, height = 3.4)
print(ann_plots[[4]])
dev.off()

Find genes that are detected in both RRST (RNA rescue = RRST) and standard data

umis_standard <- rownames(CLN)[rowSums(GetAssayData(CLN, slot = "counts")[, CLN$protocol == "standard"]) > 0]
umis_RRST <- rownames(CLN)[rowSums(GetAssayData(CLN, slot = "counts")[, CLN$protocol == "RNA rescue"]) > 0]

genes.keep <- intersect(umis_standard, umis_RRST)

Subset and normalize data.

CLN.subset <- SubsetSTData(CLN, features = genes.keep)
CLN.subset <- CLN.subset %>% 
  NormalizeData() %>% 
  ScaleData()
## Centering and scaling data matrix

Create plots for Figure 3 e


The marker genes were selected using the Gut Cell Atlas

Link to paper: https://doi.org/10.1038/s41586-021-03852-1

ST.FeaturePlot(CLN.subset, features = "labels", ncol = 6, show.sb = FALSE)

Spatial distribution of selected marker genes.

selected.genes <- c("CLDN3", "CLDN4", "CLDN7", "FABP1", "SLC26A2", "SLC26A3", "MS4A12", "CEACAM7", "AQP8", "KRT20", "PIGR")
ST.FeaturePlot(CLN.subset, features = selected.genes, ncol = 11, grid.ncol = 1, show.sb = F)

Figure 3 e


gg <- cbind(CLN.subset[[]], FetchData(CLN.subset, vars = selected.genes)) %>%
  subset(labels == "mucosa") %>%
  reshape2::melt(measure.vars = selected.genes) %>%
  mutate(protocol = setNames(c("RRST", "standard"), nm = c("RNA rescue", "standard"))[protocol])

ggs <- gg %>% 
  group_by(protocol, cln_id, variable) %>%
  summarize(det = paste0(round(sum(value > 0)/n(), digits = 2)*100, "%"))
## `summarise()` has grouped output by 'protocol', 'cln_id'. You can override
## using the `.groups` argument.
p <- ggplot() +
  geom_violin(data = gg, aes(protocol, value, fill = protocol), scale = "width") +
  geom_label(data = ggs, aes(protocol, -1, fill = protocol, label = det)) +
  facet_grid(cln_id ~ variable) +
  labs(y = "Normalized expression") +
  theme(axis.text.x = element_blank(), 
        axis.title.x = element_blank(),
        axis.title.y = element_text(size = 16, color = "black"),
        strip.text = element_text(size = 14, color = "black", face = "bold"),
        legend.text = element_text(size = 14),
        legend.title = element_text(size = 14),
        axis.text.y = element_text(size = 14, color = "black"),
        panel.background = element_rect(fill = "white"),
        panel.grid = element_line(colour = "lightgray", linetype = "longdash"),
        legend.position = "bottom") +
  scale_fill_brewer(palette = "Pastel1")
p <- ggrastr::rasterize(p, layers = "Point", dpi = 300)
p

pdf(file = "plots/selected_markers_violin.pdf", width = 18, height = 5.5)
print(p)
dev.off()

date


date()
## [1] "Thu Aug 25 11:32:18 2022"

Session


devtools::session_info()
## ─ Session info ───────────────────────────────────────────────────────────────
##  setting  value
##  version  R version 4.1.3 (2022-03-10)
##  os       macOS Big Sur/Monterey 10.16
##  system   x86_64, darwin13.4.0
##  ui       unknown
##  language (EN)
##  collate  en_US.UTF-8
##  ctype    en_US.UTF-8
##  tz       Europe/Stockholm
##  date     2022-08-25
##  pandoc   2.18 @ /Applications/RStudio.app/Contents/MacOS/quarto/bin/tools/ (via rmarkdown)
## 
## ─ Packages ───────────────────────────────────────────────────────────────────
##  package         * version date (UTC) lib source
##  abind             1.4-5   2016-07-21 [1] CRAN (R 4.1.0)
##  assertthat        0.2.1   2019-03-21 [1] CRAN (R 4.1.0)
##  backports         1.4.1   2021-12-13 [1] CRAN (R 4.1.1)
##  beeswarm          0.4.0   2021-06-01 [1] CRAN (R 4.1.0)
##  bit               4.0.4   2020-08-04 [1] CRAN (R 4.1.0)
##  bit64             4.0.5   2020-08-30 [1] CRAN (R 4.1.0)
##  bmp               0.3     2017-09-11 [1] CRAN (R 4.1.3)
##  brio              1.1.3   2021-11-30 [1] CRAN (R 4.1.1)
##  broom             0.8.0   2022-04-13 [1] CRAN (R 4.1.3)
##  bslib             0.3.1   2021-10-06 [1] CRAN (R 4.1.1)
##  cachem            1.0.6   2021-08-19 [1] CRAN (R 4.1.1)
##  Cairo             1.5-15  2022-03-16 [1] CRAN (R 4.1.2)
##  callr             3.7.0   2021-04-20 [1] CRAN (R 4.1.0)
##  car               3.0-13  2022-05-02 [1] CRAN (R 4.1.3)
##  carData           3.0-5   2022-01-06 [1] CRAN (R 4.1.2)
##  cli               3.2.0   2022-02-14 [1] CRAN (R 4.1.2)
##  cluster           2.1.3   2022-03-28 [1] CRAN (R 4.1.2)
##  codetools         0.2-18  2020-11-04 [1] CRAN (R 4.1.0)
##  colorspace        2.0-3   2022-02-21 [1] CRAN (R 4.1.2)
##  cowplot           1.1.1   2020-12-30 [1] CRAN (R 4.1.0)
##  crayon            1.5.1   2022-03-26 [1] CRAN (R 4.1.2)
##  data.table        1.14.2  2021-09-27 [1] CRAN (R 4.1.1)
##  DBI               1.1.2   2021-12-20 [1] CRAN (R 4.1.2)
##  deldir            1.0-6   2021-10-23 [1] CRAN (R 4.1.1)
##  desc              1.4.1   2022-03-06 [1] CRAN (R 4.1.2)
##  devtools          2.4.3   2021-11-30 [1] CRAN (R 4.1.1)
##  digest            0.6.29  2021-12-01 [1] CRAN (R 4.1.1)
##  dplyr           * 1.0.8   2022-02-08 [1] CRAN (R 4.1.2)
##  ellipsis          0.3.2   2021-04-29 [1] CRAN (R 4.1.0)
##  evaluate          0.15    2022-02-18 [1] CRAN (R 4.1.2)
##  fansi             1.0.3   2022-03-24 [1] CRAN (R 4.1.2)
##  farver            2.1.0   2021-02-28 [1] CRAN (R 4.1.0)
##  fastmap           1.1.0   2021-01-25 [1] CRAN (R 4.1.0)
##  fitdistrplus      1.1-8   2022-03-10 [1] CRAN (R 4.1.3)
##  fs                1.5.2   2021-12-08 [1] CRAN (R 4.1.3)
##  future            1.24.0  2022-02-19 [1] CRAN (R 4.1.2)
##  future.apply      1.8.1   2021-08-10 [1] CRAN (R 4.1.1)
##  generics          0.1.2   2022-01-31 [1] CRAN (R 4.1.2)
##  ggbeeswarm        0.6.0   2017-08-07 [1] CRAN (R 4.1.0)
##  ggplot2         * 3.3.5   2021-06-25 [1] CRAN (R 4.1.0)
##  ggpubr          * 0.4.0   2020-06-27 [1] CRAN (R 4.1.0)
##  ggrastr           1.0.1   2021-12-08 [1] CRAN (R 4.1.1)
##  ggrepel           0.9.1   2021-01-15 [1] CRAN (R 4.1.0)
##  ggridges          0.5.3   2021-01-08 [1] CRAN (R 4.1.3)
##  ggsignif          0.6.3   2021-09-09 [1] CRAN (R 4.1.1)
##  globals           0.14.0  2020-11-22 [1] CRAN (R 4.1.0)
##  glue              1.6.2   2022-02-24 [1] CRAN (R 4.1.2)
##  goftest           1.2-3   2021-10-07 [1] CRAN (R 4.1.3)
##  gridExtra         2.3     2017-09-09 [1] CRAN (R 4.1.3)
##  gtable            0.3.0   2019-03-25 [1] CRAN (R 4.1.0)
##  hdf5r             1.3.5   2021-11-15 [1] CRAN (R 4.1.1)
##  highr             0.9     2021-04-16 [1] CRAN (R 4.1.0)
##  htmltools         0.5.2   2021-08-25 [1] CRAN (R 4.1.1)
##  htmlwidgets       1.5.4   2021-09-08 [1] CRAN (R 4.1.1)
##  httpuv            1.6.5   2022-01-05 [1] CRAN (R 4.1.2)
##  httr              1.4.2   2020-07-20 [1] CRAN (R 4.1.0)
##  ica               1.0-2   2018-05-24 [1] CRAN (R 4.1.3)
##  igraph            1.3.0   2022-04-01 [1] CRAN (R 4.1.3)
##  imager            0.42.13 2022-03-07 [1] CRAN (R 4.1.3)
##  irlba             2.3.5   2021-12-06 [1] CRAN (R 4.1.3)
##  jpeg              0.1-9   2021-07-24 [1] CRAN (R 4.1.3)
##  jquerylib         0.1.4   2021-04-26 [1] CRAN (R 4.1.0)
##  jsonlite          1.8.0   2022-02-22 [1] CRAN (R 4.1.2)
##  KernSmooth        2.23-20 2021-05-03 [1] CRAN (R 4.1.0)
##  knitr             1.38    2022-03-25 [1] CRAN (R 4.1.2)
##  labeling          0.4.2   2020-10-20 [1] CRAN (R 4.1.2)
##  later             1.3.0   2021-08-18 [1] CRAN (R 4.1.3)
##  lattice           0.20-45 2021-09-22 [1] CRAN (R 4.1.1)
##  lazyeval          0.2.2   2019-03-15 [1] CRAN (R 4.1.0)
##  leiden            0.3.9   2021-07-27 [1] CRAN (R 4.1.3)
##  lifecycle         1.0.1   2021-09-24 [1] CRAN (R 4.1.1)
##  listenv           0.8.0   2019-12-05 [1] CRAN (R 4.1.0)
##  lmtest            0.9-40  2022-03-21 [1] CRAN (R 4.1.3)
##  magick            2.7.3   2021-08-18 [1] CRAN (R 4.1.3)
##  magrittr        * 2.0.3   2022-03-30 [1] CRAN (R 4.1.3)
##  MASS              7.3-56  2022-03-23 [1] CRAN (R 4.1.2)
##  Matrix            1.4-1   2022-03-23 [1] CRAN (R 4.1.2)
##  matrixStats       0.62.0  2022-04-19 [1] CRAN (R 4.1.3)
##  memoise           2.0.1   2021-11-26 [1] CRAN (R 4.1.1)
##  mgcv              1.8-40  2022-03-29 [1] CRAN (R 4.1.3)
##  mime              0.12    2021-09-28 [1] CRAN (R 4.1.1)
##  miniUI            0.1.1.1 2018-05-18 [1] CRAN (R 4.1.0)
##  munsell           0.5.0   2018-06-12 [1] CRAN (R 4.1.2)
##  nlme              3.1-157 2022-03-25 [1] CRAN (R 4.1.2)
##  openxlsx          4.2.5   2021-12-14 [1] CRAN (R 4.1.3)
##  parallelly        1.31.0  2022-04-07 [1] CRAN (R 4.1.3)
##  patchwork         1.1.1   2020-12-17 [1] CRAN (R 4.1.3)
##  pbapply           1.5-0   2021-09-16 [1] CRAN (R 4.1.3)
##  pillar            1.7.0   2022-02-01 [1] CRAN (R 4.1.2)
##  pkgbuild          1.3.1   2021-12-20 [1] CRAN (R 4.1.2)
##  pkgconfig         2.0.3   2019-09-22 [1] CRAN (R 4.1.0)
##  pkgload           1.2.4   2021-11-30 [1] CRAN (R 4.1.1)
##  plotly            4.10.0  2021-10-09 [1] CRAN (R 4.1.3)
##  plyr              1.8.7   2022-03-24 [1] CRAN (R 4.1.2)
##  png               0.1-7   2013-12-03 [1] CRAN (R 4.1.0)
##  polyclip          1.10-0  2019-03-14 [1] CRAN (R 4.1.3)
##  prettyunits       1.1.1   2020-01-24 [1] CRAN (R 4.1.0)
##  processx          3.5.3   2022-03-25 [1] CRAN (R 4.1.2)
##  promises          1.2.0.1 2021-02-11 [1] CRAN (R 4.1.0)
##  ps                1.6.0   2021-02-28 [1] CRAN (R 4.1.0)
##  purrr             0.3.4   2020-04-17 [1] CRAN (R 4.1.0)
##  R6                2.5.1   2021-08-19 [1] CRAN (R 4.1.1)
##  RANN              2.6.1   2019-01-08 [1] CRAN (R 4.1.3)
##  raster            3.5-15  2022-01-22 [1] CRAN (R 4.1.2)
##  RColorBrewer      1.1-3   2022-04-03 [1] CRAN (R 4.1.3)
##  Rcpp              1.0.8.3 2022-03-17 [1] CRAN (R 4.1.2)
##  RcppAnnoy         0.0.19  2021-07-30 [1] CRAN (R 4.1.3)
##  readbitmap        0.1.5   2018-06-27 [1] CRAN (R 4.1.3)
##  remotes           2.4.2   2021-11-30 [1] CRAN (R 4.1.1)
##  reshape2          1.4.4   2020-04-09 [1] CRAN (R 4.1.0)
##  reticulate        1.24    2022-01-26 [1] CRAN (R 4.1.3)
##  rlang             1.0.2   2022-03-04 [1] CRAN (R 4.1.2)
##  rmarkdown         2.13    2022-03-10 [1] CRAN (R 4.1.2)
##  ROCR              1.0-11  2020-05-02 [1] CRAN (R 4.1.3)
##  rpart             4.1.16  2022-01-24 [1] CRAN (R 4.1.2)
##  rprojroot         2.0.3   2022-04-02 [1] CRAN (R 4.1.3)
##  rstatix           0.7.0   2021-02-13 [1] CRAN (R 4.1.0)
##  rstudioapi        0.13    2020-11-12 [1] CRAN (R 4.1.0)
##  Rtsne             0.16    2022-04-17 [1] CRAN (R 4.1.3)
##  sass              0.4.1   2022-03-23 [1] CRAN (R 4.1.2)
##  scales            1.2.0   2022-04-13 [1] CRAN (R 4.1.3)
##  scattermore       0.8     2022-02-14 [1] CRAN (R 4.1.3)
##  sctransform       0.3.3   2022-01-13 [1] CRAN (R 4.1.3)
##  sessioninfo       1.2.2   2021-12-06 [1] CRAN (R 4.1.1)
##  Seurat          * 4.1.0   2022-01-14 [1] CRAN (R 4.1.3)
##  SeuratObject    * 4.0.4   2021-11-23 [1] CRAN (R 4.1.3)
##  shiny             1.7.1   2021-10-02 [1] CRAN (R 4.1.1)
##  shinyjs           2.1.0   2021-12-23 [1] CRAN (R 4.1.3)
##  sp                1.4-6   2021-11-14 [1] CRAN (R 4.1.1)
##  spatstat.core     2.4-2   2022-04-01 [1] CRAN (R 4.1.3)
##  spatstat.data     2.2-0   2022-04-18 [1] CRAN (R 4.1.3)
##  spatstat.geom     2.4-0   2022-03-29 [1] CRAN (R 4.1.3)
##  spatstat.random   2.2-0   2022-03-30 [1] CRAN (R 4.1.3)
##  spatstat.sparse   2.1-1   2022-04-18 [1] CRAN (R 4.1.3)
##  spatstat.utils    2.3-0   2021-12-12 [1] CRAN (R 4.1.3)
##  stringi           1.7.6   2021-11-29 [1] CRAN (R 4.1.1)
##  stringr           1.4.0   2019-02-10 [1] CRAN (R 4.1.0)
##  STutility       * 0.1.0   2022-05-19 [1] local
##  survival          3.3-1   2022-03-03 [1] CRAN (R 4.1.2)
##  tensor            1.5     2012-05-05 [1] CRAN (R 4.1.3)
##  terra             1.5-21  2022-02-17 [1] CRAN (R 4.1.2)
##  testthat          3.1.3   2022-03-29 [1] CRAN (R 4.1.3)
##  tibble            3.1.6   2021-11-07 [1] CRAN (R 4.1.1)
##  tidyr             1.2.0   2022-02-01 [1] CRAN (R 4.1.2)
##  tidyselect        1.1.2   2022-02-21 [1] CRAN (R 4.1.2)
##  tiff              0.1-11  2022-01-31 [1] CRAN (R 4.1.3)
##  usethis           2.1.5   2021-12-09 [1] CRAN (R 4.1.1)
##  utf8              1.2.2   2021-07-24 [1] CRAN (R 4.1.0)
##  uwot              0.1.11  2021-12-02 [1] CRAN (R 4.1.3)
##  vctrs             0.4.1   2022-04-13 [1] CRAN (R 4.1.3)
##  vipor             0.4.5   2017-03-22 [1] CRAN (R 4.1.0)
##  viridis           0.6.2   2021-10-13 [1] CRAN (R 4.1.3)
##  viridisLite       0.4.0   2021-04-13 [1] CRAN (R 4.1.0)
##  withr             2.5.0   2022-03-03 [1] CRAN (R 4.1.2)
##  xfun              0.30    2022-03-02 [1] CRAN (R 4.1.2)
##  xtable            1.8-4   2019-04-21 [1] CRAN (R 4.1.0)
##  yaml              2.3.5   2022-02-21 [1] CRAN (R 4.1.2)
##  zeallot           0.1.0   2018-01-28 [1] CRAN (R 4.1.3)
##  zip               2.2.0   2021-05-31 [1] CRAN (R 4.1.0)
##  zoo               1.8-10  2022-04-15 [1] CRAN (R 4.1.3)
## 
##  [1] /Users/ludviglarsson/anaconda3/envs/R4.1/lib/R/library
## 
## ──────────────────────────────────────────────────────────────────────────────